//
//  ADUserModel.swift
//  myBlog
//
//  Created by mac2014 on 16/3/27.
//  Copyright © 2016年 AD. All rights reserved.
//

import UIKit
/// 微博用户模型
class ADUserModel: NSObject {
    /// 用户UID
    var id: Int64 = 0
    
    /// 用户头像地址（中图），50×50像素
    var profile_image_url: String?
    
    /// 用户昵称
    var screen_name: String?
    
    /// 会员等级 1-6
    var mbrank: Int = 0 {
        didSet {
            if mbrank < 6 && mbrank > 0 {
                memberImage = UIImage(named: "common_icon_membership_level\(mbrank)")
            }else {
                //没有会员等级
                memberImage = nil
            }
        }
    }
    
    
    //微博等级对应的图片
    var memberImage: UIImage?
    
    //
    
    /// verified_type 没有认证:-1   认证用户:0  企业认证:2,3,5  达人:220
    var verified_type: Int = -1 {
        didSet {
            switch verified_type {
            case 0:
                certificateImgage = UIImage(named: "avatar_vip")
            case 2,3,5:
                certificateImgage = UIImage(named: "avatar_enterprise_vip")
            case 220:
                certificateImgage = UIImage(named: "avatar_grassroot")
            default:
                certificateImgage = nil
            }
        }
    }
    
    //认证图片
    var certificateImgage: UIImage?
    
    /// 字典转模型
    init(dict: [String: AnyObject]) {
        super.init()
        setValuesForKeysWithDictionary(dict)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        
    }

}
